package com.forever.okhttpdemo;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.forever.okhttpdemo.thread.PartPostFileAndLoginAsyncTask;

public class MainActivity extends Activity {
	TextView textView1;
	ImageView imageView1;
	String url = "http://192.168.1.155:8080/Forever/wangyong";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		textView1 = (TextView) findViewById(R.id.textView1);
		imageView1 = (ImageView) findViewById(R.id.imageView1);

		// OkHttpClient client = new OkHttpClient();
		// Request request = new Request.Builder().url(url).build();
		// 同步方法。注意不要再主线程里面
		// Response response = client.newCall(request).execute();
		// byte[] mbyte = response.body().bytes();
		// Toast.makeText(this, new String(mbyte), 0).show();

		// new LoginAsyncTask(this).execute(url);

		// String string =
		// "view-source:www.fantem.com/upfile/android/version_file.xml";
		new PartPostFileAndLoginAsyncTask(this).execute(url);
	}

}
